3.59 \(\int \frac{\csc ^3(e+f x)}{a+b \tan ^2(e+f x)} \, dx\)

Optimal. Leaf size=89 \[ -\frac{(a-2 b) \tanh ^{-1}(\cos (e+f x))}{2 a^2 f}-\frac{\sqrt{b} \sqrt{a-b} \tan ^{-1}\left (\frac{\sqrt{b} \sec (e+f x)}{\sqrt{a-b}}\right )}{a^2 f}-\frac{\cot (e+f x) \csc (e+f x)}{2 a f} \]

[Out]

-((Sqrt[a - b]*Sqrt[b]*ArcTan[(Sqrt[b]*Sec[e + f*x])/Sqrt[a - b]])/(a^2*f)) - ((a - 2*b)*ArcTanh[Cos[e + f*x]]
)/(2*a^2*f) - (Cot[e + f*x]*Csc[e + f*x])/(2*a*f)

________________________________________________________________________________________

Rubi [A]  time = 0.102602, antiderivative size = 89, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.217, Rules used = {3664, 471, 522, 207, 205} \[ -\frac{(a-2 b) \tanh ^{-1}(\cos (e+f x))}{2 a^2 f}-\frac{\sqrt{b} \sqrt{a-b} \tan ^{-1}\left (\frac{\sqrt{b} \sec (e+f x)}{\sqrt{a-b}}\right )}{a^2 f}-\frac{\cot (e+f x) \csc (e+f x)}{2 a f} \]

Antiderivative was successfully verified.

[In]

Int[Csc[e + f*x]^3/(a + b*Tan[e + f*x]^2),x]

[Out]

-((Sqrt[a - b]*Sqrt[b]*ArcTan[(Sqrt[b]*Sec[e + f*x])/Sqrt[a - b]])/(a^2*f)) - ((a - 2*b)*ArcTanh[Cos[e + f*x]]
)/(2*a^2*f) - (Cot[e + f*x]*Csc[e + f*x])/(2*a*f)

Rule 3664

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = Free
Factors[Sec[e + f*x], x]}, Dist[1/(f*ff^m), Subst[Int[((-1 + ff^2*x^2)^((m - 1)/2)*(a - b + b*ff^2*x^2)^p)/x^(
m + 1), x], x, Sec[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rule 471

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[(e^(n -
1)*(e*x)^(m - n + 1)*(a + b*x^n)^(p + 1)*(c + d*x^n)^(q + 1))/(n*(b*c - a*d)*(p + 1)), x] - Dist[e^n/(n*(b*c -
 a*d)*(p + 1)), Int[(e*x)^(m - n)*(a + b*x^n)^(p + 1)*(c + d*x^n)^q*Simp[c*(m - n + 1) + d*(m + n*(p + q + 1)
+ 1)*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, q}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && LtQ[p, -1] && GeQ[n
, m - n + 1] && GtQ[m - n + 1, 0] && IntBinomialQ[a, b, c, d, e, m, n, p, q, x]

Rule 522

Int[((e_) + (f_.)*(x_)^(n_))/(((a_) + (b_.)*(x_)^(n_))*((c_) + (d_.)*(x_)^(n_))), x_Symbol] :> Dist[(b*e - a*f
)/(b*c - a*d), Int[1/(a + b*x^n), x], x] - Dist[(d*e - c*f)/(b*c - a*d), Int[1/(c + d*x^n), x], x] /; FreeQ[{a
, b, c, d, e, f, n}, x]

Rule 207

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTanh[(Rt[b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rubi steps

\begin{align*} \int \frac{\csc ^3(e+f x)}{a+b \tan ^2(e+f x)} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{x^2}{\left (-1+x^2\right )^2 \left (a-b+b x^2\right )} \, dx,x,\sec (e+f x)\right )}{f}\\ &=-\frac{\cot (e+f x) \csc (e+f x)}{2 a f}+\frac{\operatorname{Subst}\left (\int \frac{a-b-b x^2}{\left (-1+x^2\right ) \left (a-b+b x^2\right )} \, dx,x,\sec (e+f x)\right )}{2 a f}\\ &=-\frac{\cot (e+f x) \csc (e+f x)}{2 a f}+\frac{(a-2 b) \operatorname{Subst}\left (\int \frac{1}{-1+x^2} \, dx,x,\sec (e+f x)\right )}{2 a^2 f}-\frac{((a-b) b) \operatorname{Subst}\left (\int \frac{1}{a-b+b x^2} \, dx,x,\sec (e+f x)\right )}{a^2 f}\\ &=-\frac{\sqrt{a-b} \sqrt{b} \tan ^{-1}\left (\frac{\sqrt{b} \sec (e+f x)}{\sqrt{a-b}}\right )}{a^2 f}-\frac{(a-2 b) \tanh ^{-1}(\cos (e+f x))}{2 a^2 f}-\frac{\cot (e+f x) \csc (e+f x)}{2 a f}\\ \end{align*}

Mathematica [B]  time = 0.66921, size = 195, normalized size = 2.19 \[ \frac{8 \sqrt{b} \sqrt{a-b} \tan ^{-1}\left (\frac{\sqrt{a-b}-\sqrt{a} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{b}}\right )+8 \sqrt{b} \sqrt{a-b} \tan ^{-1}\left (\frac{\sqrt{a-b}+\sqrt{a} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{b}}\right )-a \csc ^2\left (\frac{1}{2} (e+f x)\right )+a \sec ^2\left (\frac{1}{2} (e+f x)\right )+4 a \log \left (\sin \left (\frac{1}{2} (e+f x)\right )\right )-4 a \log \left (\cos \left (\frac{1}{2} (e+f x)\right )\right )-8 b \log \left (\sin \left (\frac{1}{2} (e+f x)\right )\right )+8 b \log \left (\cos \left (\frac{1}{2} (e+f x)\right )\right )}{8 a^2 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[e + f*x]^3/(a + b*Tan[e + f*x]^2),x]

[Out]

(8*Sqrt[a - b]*Sqrt[b]*ArcTan[(Sqrt[a - b] - Sqrt[a]*Tan[(e + f*x)/2])/Sqrt[b]] + 8*Sqrt[a - b]*Sqrt[b]*ArcTan
[(Sqrt[a - b] + Sqrt[a]*Tan[(e + f*x)/2])/Sqrt[b]] - a*Csc[(e + f*x)/2]^2 - 4*a*Log[Cos[(e + f*x)/2]] + 8*b*Lo
g[Cos[(e + f*x)/2]] + 4*a*Log[Sin[(e + f*x)/2]] - 8*b*Log[Sin[(e + f*x)/2]] + a*Sec[(e + f*x)/2]^2)/(8*a^2*f)

________________________________________________________________________________________

Maple [B]  time = 0.078, size = 189, normalized size = 2.1 \begin{align*}{\frac{1}{4\,fa \left ( \cos \left ( fx+e \right ) +1 \right ) }}-{\frac{\ln \left ( \cos \left ( fx+e \right ) +1 \right ) }{4\,fa}}+{\frac{\ln \left ( \cos \left ( fx+e \right ) +1 \right ) b}{2\,f{a}^{2}}}+{\frac{b}{fa}\arctan \left ({ \left ( a-b \right ) \cos \left ( fx+e \right ){\frac{1}{\sqrt{b \left ( a-b \right ) }}}} \right ){\frac{1}{\sqrt{b \left ( a-b \right ) }}}}-{\frac{{b}^{2}}{f{a}^{2}}\arctan \left ({ \left ( a-b \right ) \cos \left ( fx+e \right ){\frac{1}{\sqrt{b \left ( a-b \right ) }}}} \right ){\frac{1}{\sqrt{b \left ( a-b \right ) }}}}+{\frac{1}{4\,fa \left ( \cos \left ( fx+e \right ) -1 \right ) }}+{\frac{\ln \left ( \cos \left ( fx+e \right ) -1 \right ) }{4\,fa}}-{\frac{\ln \left ( \cos \left ( fx+e \right ) -1 \right ) b}{2\,f{a}^{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(f*x+e)^3/(a+b*tan(f*x+e)^2),x)

[Out]

1/4/f/a/(cos(f*x+e)+1)-1/4/f/a*ln(cos(f*x+e)+1)+1/2/f/a^2*ln(cos(f*x+e)+1)*b+1/f*b/a/(b*(a-b))^(1/2)*arctan((a
-b)*cos(f*x+e)/(b*(a-b))^(1/2))-1/f*b^2/a^2/(b*(a-b))^(1/2)*arctan((a-b)*cos(f*x+e)/(b*(a-b))^(1/2))+1/4/f/a/(
cos(f*x+e)-1)+1/4/f/a*ln(cos(f*x+e)-1)-1/2/f/a^2*ln(cos(f*x+e)-1)*b

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^3/(a+b*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 2.28141, size = 815, normalized size = 9.16 \begin{align*} \left [\frac{2 \, \sqrt{-a b + b^{2}}{\left (\cos \left (f x + e\right )^{2} - 1\right )} \log \left (-\frac{{\left (a - b\right )} \cos \left (f x + e\right )^{2} + 2 \, \sqrt{-a b + b^{2}} \cos \left (f x + e\right ) - b}{{\left (a - b\right )} \cos \left (f x + e\right )^{2} + b}\right ) + 2 \, a \cos \left (f x + e\right ) -{\left ({\left (a - 2 \, b\right )} \cos \left (f x + e\right )^{2} - a + 2 \, b\right )} \log \left (\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) +{\left ({\left (a - 2 \, b\right )} \cos \left (f x + e\right )^{2} - a + 2 \, b\right )} \log \left (-\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right )}{4 \,{\left (a^{2} f \cos \left (f x + e\right )^{2} - a^{2} f\right )}}, \frac{4 \, \sqrt{a b - b^{2}}{\left (\cos \left (f x + e\right )^{2} - 1\right )} \arctan \left (\frac{\sqrt{a b - b^{2}} \cos \left (f x + e\right )}{b}\right ) + 2 \, a \cos \left (f x + e\right ) -{\left ({\left (a - 2 \, b\right )} \cos \left (f x + e\right )^{2} - a + 2 \, b\right )} \log \left (\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right ) +{\left ({\left (a - 2 \, b\right )} \cos \left (f x + e\right )^{2} - a + 2 \, b\right )} \log \left (-\frac{1}{2} \, \cos \left (f x + e\right ) + \frac{1}{2}\right )}{4 \,{\left (a^{2} f \cos \left (f x + e\right )^{2} - a^{2} f\right )}}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^3/(a+b*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

[1/4*(2*sqrt(-a*b + b^2)*(cos(f*x + e)^2 - 1)*log(-((a - b)*cos(f*x + e)^2 + 2*sqrt(-a*b + b^2)*cos(f*x + e) -
 b)/((a - b)*cos(f*x + e)^2 + b)) + 2*a*cos(f*x + e) - ((a - 2*b)*cos(f*x + e)^2 - a + 2*b)*log(1/2*cos(f*x +
e) + 1/2) + ((a - 2*b)*cos(f*x + e)^2 - a + 2*b)*log(-1/2*cos(f*x + e) + 1/2))/(a^2*f*cos(f*x + e)^2 - a^2*f),
 1/4*(4*sqrt(a*b - b^2)*(cos(f*x + e)^2 - 1)*arctan(sqrt(a*b - b^2)*cos(f*x + e)/b) + 2*a*cos(f*x + e) - ((a -
 2*b)*cos(f*x + e)^2 - a + 2*b)*log(1/2*cos(f*x + e) + 1/2) + ((a - 2*b)*cos(f*x + e)^2 - a + 2*b)*log(-1/2*co
s(f*x + e) + 1/2))/(a^2*f*cos(f*x + e)^2 - a^2*f)]

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\csc ^{3}{\left (e + f x \right )}}{a + b \tan ^{2}{\left (e + f x \right )}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)**3/(a+b*tan(f*x+e)**2),x)

[Out]

Integral(csc(e + f*x)**3/(a + b*tan(e + f*x)**2), x)

________________________________________________________________________________________

Giac [B]  time = 1.43536, size = 285, normalized size = 3.2 \begin{align*} \frac{\frac{2 \,{\left (a - 2 \, b\right )} \log \left (-\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )}{a^{2}} - \frac{8 \, \sqrt{a b - b^{2}} \arctan \left (-\frac{a \cos \left (f x + e\right ) - b \cos \left (f x + e\right ) - b}{\sqrt{a b - b^{2}} \cos \left (f x + e\right ) + \sqrt{a b - b^{2}}}\right )}{a^{2}} + \frac{{\left (a - \frac{2 \, a{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{4 \, b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1}\right )}{\left (\cos \left (f x + e\right ) + 1\right )}}{a^{2}{\left (\cos \left (f x + e\right ) - 1\right )}} - \frac{\cos \left (f x + e\right ) - 1}{a{\left (\cos \left (f x + e\right ) + 1\right )}}}{8 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^3/(a+b*tan(f*x+e)^2),x, algorithm="giac")

[Out]

1/8*(2*(a - 2*b)*log(-(cos(f*x + e) - 1)/(cos(f*x + e) + 1))/a^2 - 8*sqrt(a*b - b^2)*arctan(-(a*cos(f*x + e) -
 b*cos(f*x + e) - b)/(sqrt(a*b - b^2)*cos(f*x + e) + sqrt(a*b - b^2)))/a^2 + (a - 2*a*(cos(f*x + e) - 1)/(cos(
f*x + e) + 1) + 4*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1))*(cos(f*x + e) + 1)/(a^2*(cos(f*x + e) - 1)) - (cos(
f*x + e) - 1)/(a*(cos(f*x + e) + 1)))/f